package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 地理位置信息对象 sys_geographical
 * 
 * @author yfkj
 * @date 2021-10-12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysGeographical
{
    private static final long serialVersionUID = 1L;

    /** 地理位置信息主键 */
    @TableField(exist = true)
    private Long geographicalId;

    /** 区域编码 */
    @com.ruoyi.common.core.annotation.Excel(name = "区域编码")
    @TableField(exist = true)
    private String geographicalCode;

    /** 区域名称 */
    @com.ruoyi.common.core.annotation.Excel(name = "区域名称")
    @TableField(exist = true)
    private String geographicalName;

    /** 父部门id */
    @com.ruoyi.common.core.annotation.Excel(name = "父部门id")
    @TableField(exist = true)
    private Long parentId;

    /** 祖级列表 */
    @com.ruoyi.common.core.annotation.Excel(name = "祖级列表")
    @TableField(exist = true)
    private String ancestors;

    /** 区域详细名称 */
    @com.ruoyi.common.core.annotation.Excel(name = "区域详细名称")
    @TableField(exist = true)
    private String geographicalFullName;

    /** 经度 */
    @com.ruoyi.common.core.annotation.Excel(name = "经度")
    @TableField(exist = true)
    private Double lng;

    /** 纬度 */
    @com.ruoyi.common.core.annotation.Excel(name = "纬度")
    @TableField(exist = true)
    private Double lat;

    /** 下级数量 */
    @com.ruoyi.common.core.annotation.Excel(name = "下级数量")
    @TableField(exist = true)
    private Integer childrenNum;

    /** 区域等级（国-country，省-province，市-city，区县-district） */
    @com.ruoyi.common.core.annotation.Excel(name = "区域等级（国-country，省-province，市-city，区县-district）")
    @TableField(exist = true)
    private String level;

    /** 上级区域地址的code */
    @com.ruoyi.common.core.annotation.Excel(name = "上级区域地址的code")
    @TableField(exist = true)
    private Integer parent;

    @TableField(exist = false)
    @ApiModelProperty(value =  "子列表")
    private List<SysGeographical> children;

    public static final String GEOGRAPHICAL_ID = "geographical_id";
    public static final String GEOGRAPHICAL_CODE = "geographical_code";
    public static final String GEOGRAPHICAL_NAME = "geographical_name";
    public static final String PARENT_ID = "parent_id";
    public static final String ANCESTORS = "ancestors";
    public static final String GEOGRAPHICAL_FULL_NAME = "geographical_full_name";
    public static final String LNG = "lng";
    public static final String LAT = "lat";
    public static final String CHILDREN_NUM = "children_num";
    public static final String LEVEL = "level";
    public static final String PARENT = "parent";

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("geographicalId", getGeographicalId())
            .append("geographicalCode", getGeographicalCode())
            .append("geographicalName", getGeographicalName())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .append("geographicalFullName", getGeographicalFullName())
            .toString();
    }
}
